package com.device.grant.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.device.grant.dao.ApparatusConfigDao;
import com.device.grant.dao.BaseDao;
import com.device.grant.pojo.ApparatusConfig;

@Repository("apparatusConfigDao")
public class ApparatusConfigDaoImpl extends BaseDao<ApparatusConfig> implements ApparatusConfigDao {

    private static final String TABLE = "ApparatusConfig";

    private static final String ID = "id";

    public List<ApparatusConfig> getApparatusConfigs(Map<String, Object> conditions) {
        return super.queryAllInCoditions(TABLE, "order by type", conditions);
    }

    public boolean deleteApparatusConfigs(Map<String, Object> conditions) {
        return delete(TABLE, conditions);
    }

    public boolean insertApparatusConfigs(ApparatusConfig config) {
        return insert(TABLE, ID, config);
    }

    public boolean updateApparatusConfig(Map<String, Object> changeInfos, Map<String, Object> conditions) {
        return update(TABLE, changeInfos, conditions);
    }
}